//
//  TestVc.m
//  phoneNmuberRule
//
//  Created by Pro on 2018/3/9.
//  Copyright © 2018年 Pro. All rights reserved.
//

#import "TestVc.h"
#import "FirstRule.h"

@interface TestVc ()

@property (weak, nonatomic) IBOutlet UITextField *phoneNmuberTF;
- (IBAction)checkBtn:(UIButton *)sender;
@end

@implementation TestVc

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

-(void)whtherPhoneNumerStatus:(BOOL)status
{
    NSString * displayStr = status ? @"成功":@"失败";
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:displayStr message:@"" preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    }]];
    [self presentViewController:alert animated:YES completion:nil];
    
}
- (IBAction)checkBtn:(UIButton *)sender {
    NSString * str = [NSString stringWithFormat:@"%@",_phoneNmuberTF.text];
    
    BOOL numberStatus =   [FirstRule isMobileNumber:str];
    [self whtherPhoneNumerStatus:numberStatus];

}
@end
